package com.jiyun.controller;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.jiyun.pojo.result.ResultVo;
import com.jiyun.pojo.user.UserVo;
import com.jiyun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 文件名:UserController
 * 创建者: 闫俊涛
 * 创建时间:2022/6/24 14:48
 * 描述:这是一个实例
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("send")
    public ResultVo send(String phone){
      return  userService.sendCode(phone);
    }

    /**
     * 手机验证码登录
     * phone 用户手机号
     * code 用户的验证码
     * return resultvo
     * */
    @RequestMapping("smsLogin")
    public ResultVo smsLogin( @RequestBody  UserVo UserVo){
        return userService.smsLogin(UserVo);
    }

}
